//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using System.ComponentModel;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Validation;
using EntLibContrib.Common.Configuration.Design;

namespace EntLibContrib.Query.Configuration.Design
{
  /// <summary>
	/// Represents a <see cref="CustomCommandData"/> configuration element.
  /// </summary>
	[Image(typeof(CommandNode))]
	[SelectedImage(typeof(CommandNode))]
	public abstract class CommandNode : NameSortConfigurationNode
	{
		#region Fields
		private string commandTypeName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the name of the node.
		/// </summary>
		/// <value>The name of the node.</value>
		[UniqueName(typeof(CommandNode), typeof(QuerySettingsNode))]
		public override string Name
		{
			get { return base.Name; }
		}

		/// <summary>
		/// Gets or sets the command type name.
		/// </summary>
		/// <value>The command type name for this node.</value>
		[Browsable(false)]
		public string CommandTypeName
		{
			get { return commandTypeName; }
			set
			{
				if (value != null)
					commandTypeName = value;
			}
		}

		/// <summary>
		/// Gets the <see cref="CustomCommandData"/> this node represents.
		/// </summary>
		/// <value>
		/// The <see cref="CustomCommandData"/> this node represents.
		/// </value>
		[Browsable(false)]
		public abstract CustomCommandData CommandData
		{
			get;
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initialize a new instance of the <see cref="CommandNode"/> class.
		/// </summary>
		protected CommandNode()
    {
		}
		#endregion
  }
}